Add explicit Z slice skipping#18
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 76624ca496
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| flow, transform, bbox_ref = compute_flow_dataset(dataset=dataset, | ||
| original_shape=original_shape, | ||
| ignore_slices=ignore_slices_flow, | ||
| ignore_slices=normalized_skip_slices, |
There was a problem hiding this comment.
Handle skipped slices at the start of flow computation
When a new skip list contains the first slice that compute_flow_dataset will process (for example --skip-slices-local <local_z_min> on a stack with first_slice/reference_path, or <local_z_min + 1> on a root stack), this passes that z into _compute_flow's ignore path before any flow has been appended. That branch constructs the placeholder from flows[-1], so flows is empty and the run raises IndexError instead of completing the requested skip; seed the placeholder independently or advance past skipped starting slices before passing them as ignore_slices.
Useful? React with 👍 / 👎.
|
|
||
| global_z = z + z_offset - dataset.domain.inclusive_min[0] | ||
|
|
||
| if z in normalized_skip_slices: |
There was a problem hiding this comment.
Skip the initial reference slice before writing it
This check only runs in the rendering loop after root/disconnected stacks have already written their first non-empty slice in the first_slice is None and reference is None block and set start = z + 1. If the user requests skipping that first local/global slice, it is still rendered to the destination and used as the reference for subsequent flow, so --skip-slices* silently fails for the first slice of a root component; handle normalized_skip_slices before choosing/writing the initial reference slice.
Useful? React with 👍 / 👎.
Motivation
Description
--skip-slicestoemalign.align_dataset_zand propagated those global indices into each stack's config before callingalign_stack_zby extendingexecute_alignmentandalign_dataset_zsignatures.--skip-slices-globaland--skip-slices-localtoemalign.scripts.align_stack_zand merged file/config values into the stackconfig.normalized_skip_slices) and passed that list intocompute_flow_dataset(asignore_slices) and used it during rendering to skip and log user-skipped slices.valid_estimatecontinues to be logged while flow-cleaning thresholds remain controlled byflow_configparameters.Testing
python -m py_compile emalign/scripts/align_stack_z.py emalign/align_dataset_z.pywhich succeeded.git diff --checkto validate whitespace/patch issues which returned clean.Codex Task